﻿using System;
using System.Threading.Tasks;

namespace EasySocket
{
    public interface IEasySocketHandler : IDisposable
    {
        Task AcceptAsync(AcceptContext acceptContext);

        Task StateChangeAsync(EasySocketState state);

        Task ReceiveDataAsync(EasySocketToken client, byte[] data);

        Task HandleErrorAsync(string sessionId, Exception error);
    }

    public interface IEasySocketClientHandler : IDisposable
    {
        Task StateChangeAsync(EasySocketClientState state);

        Task ReceiveDataAsync(byte[] data);

        Task HandleErrorAsync(Exception error);
    }
}
